3.619 \(\int \frac {a^2-b^2 \cos ^2(c+d x)}{a+b \cos (c+d x)} \, dx\)

Optimal. Leaf size=16 \[ a x-\frac {b \sin (c+d x)}{d} \]

[Out]

a*x-b*sin(d*x+c)/d

________________________________________________________________________________________

Rubi [A]  time = 0.05, antiderivative size = 16, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 30, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.067, Rules used = {3016, 2637} \[ a x-\frac {b \sin (c+d x)}{d} \]

Antiderivative was successfully verified.

[In]

Int[(a^2 - b^2*Cos[c + d*x]^2)/(a + b*Cos[c + d*x]),x]

[Out]

a*x - (b*Sin[c + d*x])/d

Rule 2637

Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 3016

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Dist[
C/b^2, Int[(a + b*Sin[e + f*x])^(m + 1)*Simp[-a + b*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, e, f, A, C, m}, x
] && EqQ[A*b^2 + a^2*C, 0]

Rubi steps

\begin {align*} \int \frac {a^2-b^2 \cos ^2(c+d x)}{a+b \cos (c+d x)} \, dx &=-\int (-a+b \cos (c+d x)) \, dx\\ &=a x-b \int \cos (c+d x) \, dx\\ &=a x-\frac {b \sin (c+d x)}{d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.01, size = 28, normalized size = 1.75 \[ a x-\frac {b \sin (c) \cos (d x)}{d}-\frac {b \cos (c) \sin (d x)}{d} \]

Antiderivative was successfully verified.

[In]

Integrate[(a^2 - b^2*Cos[c + d*x]^2)/(a + b*Cos[c + d*x]),x]

[Out]

a*x - (b*Cos[d*x]*Sin[c])/d - (b*Cos[c]*Sin[d*x])/d

________________________________________________________________________________________

fricas [A]  time = 0.57, size = 18, normalized size = 1.12 \[ \frac {a d x - b \sin \left (d x + c\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a^2-b^2*cos(d*x+c)^2)/(a+b*cos(d*x+c)),x, algorithm="fricas")

[Out]

(a*d*x - b*sin(d*x + c))/d

________________________________________________________________________________________

giac [B]  time = 0.39, size = 39, normalized size = 2.44 \[ \frac {{\left (d x + c\right )} a - \frac {2 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1}}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a^2-b^2*cos(d*x+c)^2)/(a+b*cos(d*x+c)),x, algorithm="giac")

[Out]

((d*x + c)*a - 2*b*tan(1/2*d*x + 1/2*c)/(tan(1/2*d*x + 1/2*c)^2 + 1))/d

________________________________________________________________________________________

maple [A]  time = 0.14, size = 22, normalized size = 1.38 \[ \frac {-b \sin \left (d x +c \right )+a \left (d x +c \right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((-cos(d*x+c)^2*b^2+a^2)/(a+b*cos(d*x+c)),x)

[Out]

1/d*(-b*sin(d*x+c)+a*(d*x+c))

________________________________________________________________________________________

maxima [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a^2-b^2*cos(d*x+c)^2)/(a+b*cos(d*x+c)),x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*b^2-4*a^2>0)', see `assume?`
 for more details)Is 4*b^2-4*a^2 positive or negative?

________________________________________________________________________________________

mupad [B]  time = 1.46, size = 19, normalized size = 1.19 \[ -\frac {b\,\sin \left (c+d\,x\right )-a\,d\,x}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a^2 - b^2*cos(c + d*x)^2)/(a + b*cos(c + d*x)),x)

[Out]

-(b*sin(c + d*x) - a*d*x)/d

________________________________________________________________________________________

sympy [A]  time = 0.68, size = 32, normalized size = 2.00 \[ \begin {cases} a x - \frac {b \sin {\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\\frac {x \left (a^{2} - b^{2} \cos ^{2}{\relax (c )}\right )}{a + b \cos {\relax (c )}} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a**2-b**2*cos(d*x+c)**2)/(a+b*cos(d*x+c)),x)

[Out]

Piecewise((a*x - b*sin(c + d*x)/d, Ne(d, 0)), (x*(a**2 - b**2*cos(c)**2)/(a + b*cos(c)), True))

________________________________________________________________________________________